package com.qf.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebServlet("/list")
public class UserListServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("----------UserListServlet(开始)-----------");
        HttpSession session = req.getSession();
        Object user = session.getAttribute("user");
        if(user!=null){
            System.out.println("登录成功");
        }else{
            System.out.println("登录失败");
        }
        System.out.println("----------UserListServlet(结束)-----------");
    }
}
